echo "ffmpeg source code will be downloaded to home directory"
echo "need permission to install to /usr"
sudo echo "permission granted"
cd ~
git clone https://git.ffmpeg.org/ffmpeg.git

echo "ffmpeg source code downloaded to `pwd`/ffmpeg"

cd ffmpeg

./configure --enable-vaapi --disable-x86asm --disable-vdpau
if [ $? ] then
	echo "failed to config ffmpeg, exit"
	exit
fi

make
if [ $? ] then
	echo "failed to compile ffmpeg, exit"
	exit
fi

echo "ffmpeg compile done"
sudo make install
if [ $? ] then
	echo "failed to install ffmpeg, exit"
	exit
fi

echo "ffmpeg installed"

